/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package dawnland02.model.quest;

import java.util.LinkedList;
import java.util.List;

/**
 * @author Petru Obreja (obrejap@yahoo.com)
 */
public class QuestManager {
     //todo: make it Set<Quest>
    private List<Quest> quests;
    //todo: make it Set<QuestObserver>
    private List<QuestObserver> questObservers;

    private static final QuestManager instance =  new QuestManager();

    public QuestManager() {
        quests =  new LinkedList<Quest>();
        questObservers = new LinkedList<QuestObserver>();
    }

    public void attach(QuestObserver questObserver){
        questObservers.add(questObserver);
    }

    public void addQuest(Quest quest){
        quests.add(quest);
        for(QuestObserver questObserver:questObservers){
            questObserver.notify(quest);
        }
    }

    public static QuestManager getQuestManager(){
        return instance;
    }
}
